<?php

$DECKROOT = getcwd(); 

include $DECKROOT . '/classes/database/'.$dbType.".php";

Class pmtDeckList
{

	var $deckList;
	var $cData;
	
	function __construct($dbHost,$dbUser,$dbPass,$dbName)
	{
		
		$this->cData = new pmtData($dbHost,$dbUser,$dbPass,$dbName);
		
		// Retrieve XML of the decklist
		$this->deckList = $this->cData->getDeckList();
		
	}
	
	function xmlOutput() {
		
		return $this->deckList;
		
	}
		
	function __destruct() {

		$this->cData->close();
		
	}
		
}


Class pmtDeck
{
	
	var $deck;
	var $deckID;
	var $deckName;
	var $deckShortDescription;
	var $deckDescription;
	var $deckStatus;
	var $deckTheme;
	
	var $cData;
	
	function __construct($dbHost,$dbUser,$dbPass,$dbName,$deckID) {
		
		$this->cData = new pmtData($dbHost,$dbUser,$dbPass,$dbName);
		
		$this->deck = $this->cData->getDeck($deckID);
		
		if (!$this->deck) {
			//Deck aanmaken?
		}
				
	}
	
	function __destruct() {
		
		$this->cData->close();
		
	}
	
	function xmlOutput() {
		
		return $this->deck;
		
	}
	
	function update($deckID, $deckName, $deckShortDescription, $deckDescription, $deckStatus, $deckTheme) {
		
		$fields = array("deckID","deckName","deckShortDescription","deckDescription","deckStatus","deckTheme");
		$values = array($deckID,$deckName,$deckShortDescription,$deckDescription,$deckStatus,$deckTheme);
		
		$this->cData->store("pmtDeck",$fields,$values);
				
	}
	
	function delete() {
		
		//Huidige deck verwijderen
		
	}
			
}
?>